/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.xml.ws.WebServiceRef;

/**
 *
 * @author AnBoCa
 */
@ManagedBean(name="userLogin")
@RequestScoped
public class UserLogin {
    @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/UserActions/UserActions.wsdl")
    private UserActions_Service service;

    private String user;
    private String pass;
    
    public UserLogin() {
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }
    
    public void doUserLogin(){
        //ingresar consulta a el web service
        boolean res=doLogin(user,pass);
        if (res){
            //redireccionar y demas
        }else{
            //enviar un mensaje de confirmacion
        }
    }

    private boolean doLogin(java.lang.String user, java.lang.String pass) {
        control.UserActions port = service.getUserActionsPort();
        return port.doLogin(user, pass);
    }
    
}
